package com.hmall.search.controller;

import com.hmall.api.domain.dto.ItemDTO;
import com.hmall.common.domain.query.ItemPageQuery;
import com.hmall.common.domain.PageDTO;

import com.hmall.search.service.ISearchService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author macro
 * @Date 2025/7/3  12:40
 * @Description 搜索服务控制器
 */
@Api(tags = "搜索相关接口")
@RestController
@RequestMapping("/search")

public class SearchController {
    @Resource
    private ISearchService searchService;

    @ApiOperation("搜索商品")
    @GetMapping("/list")
    public PageDTO<ItemDTO> search(ItemPageQuery query) {
        return searchService.search(query);
    }
} 